﻿//-----------------------------------------------------------------------
// <copyright file="Sentence.cs" company="tuliprules.org">
//     Copyright (c) 2011 tuplelister, tuliprules.org.
// </copyright>
// <summary>This is the Sentence class.</summary>
//-----------------------------------------------------------------------
namespace Tulip.Rules.Models.Rif.Prd
{
    using System;
    using System.ComponentModel;
    using System.Xml.Serialization;

    /// <summary>
    /// Represents a sentence role, containing RULE or Group.
    /// </summary>
    [Serializable]
    [DesignerCategory(@"code")]
    [XmlType(AnonymousType = true, Namespace = "http://www.w3.org/2007/rif#")]
    [XmlRoot(Namespace = "http://www.w3.org/2007/rif#", IsNullable = false)]
    public class Sentence : IRifPrdElement
    {
        /// <summary>
        /// The item field.
        /// </summary>
        [EditorBrowsable(EditorBrowsableState.Never)]
        private object itemField;

        /// <summary>
        /// Gets or sets an atom formula, positional or with named arguments,
        /// a quantified formula for 'Forall', containing declare and formula roles,
        /// a frame formula, a nested collection of sentences or an implication,
        /// containing if and then roles.
        /// </summary>
        [XmlElement("Group", typeof(Group), Order = 0)]
        [XmlElement("Forall", typeof(Forall), Order = 0)]
        [XmlElement("Implies", typeof(Implies), Order = 0)]
        [XmlElement("Do", typeof(Do), Order = 0)]
        [XmlElement("And", typeof(Andthentype), Order = 0)]
        [XmlElement("Atom", typeof(Atom), Order = 0)]
        [XmlElement("Frame", typeof(Frame), Order = 0)]
        public object Item
        {
            get
            {
                return this.itemField;
            }

            set
            {
                this.itemField = value;
            }
        }
    }
}
